package com.kim.rssreader.activity;

import cn.waps.AppConnect;

import com.kim.rssreader.R;

import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.Toast;

public class SettingsActivity extends BaseActivity implements OnClickListener {
	// private RelativeLayout rl_NightMod;
	private RelativeLayout rl_TextFont;
	private RelativeLayout rl_About;
	private RelativeLayout rl_CheckUpdata;
	private RelativeLayout rl_suggestions;

	private ImageView img_Back;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	}

	@Override
	public void initParam() {

	}

	@Override
	public void initView() {
		setContentView(R.layout.rss_settings);

		// rl_NightMod = (RelativeLayout)
		// findViewById(R.id.rss_settings_nightmode);
		rl_TextFont = (RelativeLayout) findViewById(R.id.rss_settings_textfont);
		rl_About = (RelativeLayout) findViewById(R.id.rss_settings_about);
		rl_CheckUpdata = (RelativeLayout) findViewById(R.id.rss_settings_checkupdata);
		rl_suggestions = (RelativeLayout) findViewById(R.id.rss_settings_suggestions);

		img_Back = (ImageView) findViewById(R.id.rss_settings_back);

		// rl_NightMod.setOnClickListener(this);
		rl_TextFont.setOnClickListener(this);
		rl_About.setOnClickListener(this);
		rl_CheckUpdata.setOnClickListener(this);
		rl_suggestions.setOnClickListener(this);
		img_Back.setOnClickListener(this);

	}

	@Override
	public void onClick(View v) {
		int Vid = v.getId();
		switch (Vid) {
		// 夜间模式
		case R.id.rss_settings_nightmode:
			Toast.makeText(this, "rss_settings_nightmode", Toast.LENGTH_SHORT)
					.show();
			break;
		// 字体设置
		case R.id.rss_settings_textfont:
			Toast.makeText(this, "rss_settings_textfont", Toast.LENGTH_SHORT)
					.show();
			break;
		// 关于
		case R.id.rss_settings_about:
			Toast.makeText(this, "rss_settings_about", Toast.LENGTH_SHORT)
					.show();
			break;
		// 检查更新
		case R.id.rss_settings_checkupdata:
			// Toast.makeText(this, "rss_settings_checkupdata",
			// Toast.LENGTH_SHORT).show();
			AppConnect.getInstance(this).checkUpdate(this);
			break;
		// 用户反馈
		case R.id.rss_settings_suggestions:
			AppConnect.getInstance(this).showFeedback();
			break;
		// 退出
		case R.id.rss_settings_back:
			this.finish();
			break;

		}
	}

}
